package com.peanut.bosskg.service.other.pay;

import com.alibaba.fastjson.JSON;
import com.peanut.bosskg.entity.ResponseMessageVO;
import com.peanut.bosskg.entity.pay.WeChatPaymentCancelDTO;
import com.peanut.bosskg.enums.FunCodeEnum;
import com.peanut.bosskg.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


@Service
@Slf4j
public class WeChatPaymentCancelService extends BaseService {


    /**
     * @param funCodeEnum
     * @param dto
     * @return
     * @throws Exception
     */
    public WeChatPaymentCancelDTO doBusiness(FunCodeEnum funCodeEnum, WeChatPaymentCancelDTO dto) throws Exception {
        log.info("撤销付款接口开始:{}，{}", funCodeEnum, dto);
        ResponseMessageVO responseMessage = applyYouFuByHttpPost(funCodeEnum, dto);
        WeChatPaymentCancelDTO cancelDTO = JSON.parseObject(responseMessage.getResData(), WeChatPaymentCancelDTO.class);
        log.info("撤销付款接口结束:{}", cancelDTO);
        return cancelDTO;
    }

}
